using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Collections;

namespace yWriter6
{
	public class clsSceneCards : IEnumerable
	{
		private Collection mvarCards;

		public clsSceneCards()
		{
			mvarCards = new Collection();
		}

		public void Clear()
		{
			mvarCards.Clear();
		}

		public int Count()
		{
			return mvarCards.Count;
		}

		public bool Contains(string ID)
		{
			return mvarCards.Contains(ID);
		}

		public void Add(ref clsSceneCard SceneCard)
		{
			string key = Conversions.ToString(SceneCard.ScID);
			if (mvarCards.Contains(key))
			{
				mvarCards.Remove(key);
			}
			mvarCards.Add(SceneCard, key);
		}

		public clsSceneCard ItemByIndex(int Index)
		{
			try
			{
				return (clsSceneCard)mvarCards[Index];
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsSceneCard result = null;
				ProjectData.ClearProjectError();
				return result;
			}
		}

		public clsSceneCard ItembyID(string ID)
		{
			try
			{
				return (clsSceneCard)mvarCards[ID];
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsSceneCard result = null;
				ProjectData.ClearProjectError();
				return result;
			}
		}

		public IEnumerator GetEnumerator()
		{
			return mvarCards.GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			//ILSpy generated this explicit interface implementation from .override directive in GetEnumerator
			return this.GetEnumerator();
		}
	}
}
